package com.hrw.android.player.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.widget.ImageButton;

import com.hrw.android.player.R;
import com.hrw.android.player.utils.Constants;

public class PlayerActivity extends Activity {
	private ImageButton back_btn;
	private Intent intent;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		intent = this.getIntent();
		setContentView(R.layout.playback_activity);
		back_btn = (ImageButton) findViewById(R.id.playback_list);
		back_btn.setOnTouchListener(back_btn_listener);
	}

	private OnTouchListener back_btn_listener = new OnTouchListener() {
		@Override
		public boolean onTouch(View v, MotionEvent event) {
			if (event.getAction() == MotionEvent.ACTION_DOWN) {

			} else if (event.getAction() == MotionEvent.ACTION_UP) {
				setResult(Constants.MENU_TO_PLAYER_RESULT_CODE, intent);
				finish();
			}
			return false;
		}
	};
}
